<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>a  页面 </title>
</head>
<body>
     <!-- a先引用 c -->
    <iframe src="http://localhost:4000/c.html" frameborder="0"  onload="load()"  id="iframe"></iframe>
</body>
<script>
  let  first  = true;
  function load() {
      if(first) {
             //把 a 引用的地址改到b
                let  iframe =  document.getElementById('iframe')
                iframe.src= 'http://localhost:3000/b.html'
                first  = false
      }else {
          console.log(iframe.contentWindow.name)
      }
  }
</script>
</html>